function Consumer(/**Channel*/channel){
    this.channel = channel;
}
require('sys').inherits(Consumer, require('events').EventEmitter);
Object.defineProperty(Consumer.prototype, 'consumerTag', {
    get: function(){
        return this._consumerTag;
    },
    set: function(consumerTag){
        if ('_consumerTag' in this) {
            if (this._consumerTag == consumerTag) return;
            connection.removeAllListeners('Amqp.Consumer[' + this._consumerTag + ']');
        }
        this._consumerTag = consumerTag;
        var consumer  = this;
        connection.addListener('Amqp.Consumer[' + this._consumerTag + ']', function(frame){
            var classId = frame.method.classId, methodId = frame.method.methodId;
            consumer.emit('Amqp.' + Amqp.Class[classId] + '.' + Amqp.Class[classId][methodId], frame);
        });
    }
});
